<?php

class ErrorController extends CController
{

    public function actionError()
    {
	$error = Yii::app()->errorHandler->error;	
	if ($error) {
	    $this->render($error['code']);
	}
	else {
	    throw new CHttpException(404, 'Page not found.');
	}
    }

}

?>
